﻿using System;
using System.IO;
using System.Linq;

namespace 文件夹文件遍历
{
    class Program
    {
        static void Main(string[] args)
        {

            var files = Directory.GetFiles(@"E:\KuGou\", "*.*", SearchOption.AllDirectories); // 遍历所有文件
            var dirs = Directory.GetDirectories(@"E:\KuGou\", "*", SearchOption.AllDirectories); //遍历所有文件夹
            foreach (var item in files)
            {
                Console.WriteLine(item);
            }
            foreach (var item in dirs)
            {
                Console.WriteLine(item);
            }

           


            Console.WriteLine("Hello World!");
        }
    }
}
